package com.hqyj.shop.service.imp;

import com.hqyj.shop.dao.DetailDao;
import com.hqyj.shop.pojo.Detail;
import com.hqyj.shop.pojo.Order;
import com.hqyj.shop.service.DetailService;
import org.apache.ibatis.annotations.Param;
import org.aspectj.weaver.ast.Or;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DetailServiceImpl implements DetailService {

    @Autowired
    private DetailDao detailDao;

    @Autowired
    private DetailService detailService;


    @Override
    public List<Order> getByDetailId() {
        List<Order> orders = detailDao.queryByOrderId();
        return orders;
    }


    @Override
    public int updateOrderByOrderStatus(@Param("orderId") int orderId, @Param("status") String status) {
        int res = detailDao.updateOneDetail(orderId,status);
        return 1;
    }
}
